﻿<%@ Page Language="C#" EnableEventValidation="false" AutoEventWireup="true" CodeBehind="xqsj.aspx.cs" Inherits="Catering.Catering_Page.yl.Daily.xqsj" %>

<!DOCTYPE html>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8"/>
    <title></title>
    <script src="../../../Scripts/jquery-1.4.1.js" type="text/javascript"></script>
    <script src="../../../Scripts/zhezhao.js" type="text/javascript"></script>
    <script type="text/javascript" src="../../../Scripts/My97DatePicker/WdatePicker.js"></script>
    <script type="text/javascript" src="../../../Scripts/uploader/jquery.uploadify.v2.1.0.min.js"></script>
    <script type="text/javascript" src="../../../Scripts/uploader/swfobject.js"></script>
    <link type="text/css" href="../../../Scripts/uploader/uploadify.css" rel="stylesheet" />
    <link href="../../../Style/center.css" rel="stylesheet" type="text/css" />
    <link href="../../../Style/sysData.css" rel="stylesheet" type="text/css" />
    <link href="../../../Style/zhezhao.css" rel="stylesheet" type="text/css" />
    <style>
        .btn{ width:83px; float:left; height:15px; cursor:pointer; line-height:15px; text-align:center; background:url(../../../Images/head_change_bg.gif) 0 0px no-repeat; border:0px; display:block; margin:auto; padding:0px; color:#285B8A;}
        .auto-style1 {
            width: 97px;
        }
    </style>
     <script type="text/javascript">         
         function click_Download(yjqk_id) {
             if (yjqk_id != null && yjqk_id != "") {
                 $("#frame_download").attr("src", "../../../UpFile/" + yjqk_id);
             }
         }
         function GetImg(id) {
             document.getElementById('file'+id).style.display = "none";
             document.getElementById('Imgfile'+id).onload();             
         }
         function click_upload(id) {
             $("#Imgfile"+id).uploadify({
                 'uploader': '../../../Scripts/uploader/uploadify.swf',
                 'script': '../../richang/Upload.aspx',
                 'cancelImg': '../../../Scripts/uploader/cancel.png',
                 'folder': '../../../UpFile',
                 'queueID': 'fileQueue',
                 'buttonImg': '../../../Images/upload.gif',
                 'auto': false,
                 'multi': true,
                 'onComplete': function fun(event, queueID, fileObj, response, data) {
                     if (response == "true") {
                         alert("文件上传成功！");
                         $("#hdn_filepath" + id).val(fileObj.name);
                         imgEdit(id);
                     }
                     else if (response == "false") {
                         alert("文件上传出错！");
                     }
                 },
                 'onSelect': function (e, queueId, fileObj) {
                     $('#Imgfile'+id).uploadifyUpload();
                 },
                 'onCancel': function (file) {

                 }
             });
             
         }         
         //编辑数据
         function imgEdit(id) {             
             var cid = $("#hdn_id" + id).val();
             var hdn_filepath = $("#hdn_filepath"+id).val();

             $.ajax({
                 type: "Post",
                 url: "xqsj.aspx/Edit",
                 data: "{'_id':'" + cid + "','hdn_filepath':'" + hdn_filepath + "'}",
                 contentType: "application/json; charset=utf-8",
                 dataType: "json",
                 success: function (data) {
                     if (data.d == "OK") {
                         alert("文件修改成功！");
                         window.location.href = 'xqsj.aspx';
                     }
                 }
             });
         }
    </script>
</head>
<body style="margin-top:10px; margin-left:0px">
    <input type="hidden" id="HidID" />
    <form id="form1" runat="server">
    <div style="width:998px;height: 46px; line-height: 40px; font-size: 13px; margin:auto;padding-top:0px;background: url(/Images/div_h1_bg_02.gif);">
            <table style="width:998px;">
                <tr>
                    <td style="width:50px">作业区:</td>
                    <td style="width:80px">
                        <asp:DropDownList ID="ddl_group" runat="server" Width="100px" AutoPostBack="True" OnSelectedIndexChanged="ddl_group_SelectedIndexChanged" CssClass="select_input_bg">
                        </asp:DropDownList>
                    </td>
                    <td style="width:50px">班组:</td>
                    <td class="auto-style1">
                        <asp:DropDownList ID="ddl_Class" runat="server" Width="100px" AutoPostBack="True" CssClass="select_input_bg">
                        </asp:DropDownList>
                    </td>                    
                    <td style="width:80px;text-align:right">发生时间:</td>
                    <td style="width:80px"><asp:TextBox ID="txt_stTime" runat="server" Width="85px"></asp:TextBox></td>
                    <td style="width:10px">至</td>
                    <td style="width:100px"><asp:TextBox ID="txt_endTime" runat="server" Width="95px"></asp:TextBox></td>
                    <td><asp:Button ID="Search" runat="server" CssClass="input_btn_a" Text="查询" Height="27px" Width="83px" OnClick="Search_Click"/></td>                    
                </tr>
            </table>
     </div>
    <div style="padding: 0px;text-align: center;"> 
        <table cellpadding="0" cellspacing="0" style="width:998px;border-left:1px solid #8b8888;border-top:1px solid #8b8888; text-align:center; margin:auto; font-size:12px;">
                <thead>
                    <tr style="background:url(../../../Images/th_02bg.gif) repeat-x 0px 0px; height:29px; ">
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">序号
                        </td>
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">发生时间
                        </td>
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">班组
                        </td>
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">事件名称
                        </td>
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">类别                            
                        </td>
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">整改措施                          
                        </td>                         
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">负责人
                        </td> 
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">关闭日期
                        </td> 
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">提交人
                        </td> 
                        <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888">操作
                        </td>                      
                    </tr>                    
                </thead>
                <tbody>
                    <asp:Repeater ID="Rep_Plan" runat="server" OnItemCommand="Rep_Plan_ItemCommand">
                        <ItemTemplate>
                        <tr>
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:50px"><%#Eval("tempId")%></td>
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:80px"><%#Eval("happenDate")%></td>
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:80px"><%#Eval("ClassName")%></td>
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:180px"><%#Eval("mingcheng")%></td>
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:80px"><%#Eval("leibie")%></td>
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;"><%#Eval("zhenggaicuoshi")%></td> 
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:50px"><%#Eval("fuzeren")%></td>
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:50px"><%#Eval("CloseDate")%></td> 
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:80px"><%#Eval("tijiaoren")%></td>                           
                            <td style="border-bottom:1px solid #8b8888;border-right:1px solid #8b8888;width:80px">
                                <div style="margin:auto; width:200px">  
                                    <asp:ImageButton ToolTip="删除" ID="ImageButton3" runat="server" ImageUrl="../../../Images/trash.gif" OnClientClick="return confirm('确认删除？');"
                                        CommandArgument='<%#Eval("id")%>' CommandName="del" />                            
                                    <input type="hidden" id="hdn_id<%#Eval("id")%>" value="<%#Eval("id")%>"/>
                                    <input type="hidden" id="hdn_filepath<%#Eval("id")%>"/>                                  
                                    <img alt="险情报告" src="../../../Images/download.gif" style="cursor: pointer;" onclick="click_Download('<%#Eval("xianqingbaogao")%>')"/>
                                    <img id="file<%#Eval("id")%>"  onload="GetImg(<%#Eval("id")%>)" alt="险情报告" src="../../../Images/upload.gif" style="cursor: pointer;" />
                                    <input type="file" id="Imgfile<%#Eval("id")%>" onload="click_upload('<%#Eval("id")%>')" title="险情报告" style="height:18px; vertical-align:middle;cursor: pointer;width:50px;display:none" />
                                    
                                </div>
                            </td>                                          
                        </tr>             
                        </ItemTemplate>
                    </asp:Repeater>
                </tbody>
            </table>
         </div>
         <!--弹出层应急情况   结束-->
    <iframe style="display:none;" id="frame_download" name="frame_download"></iframe>
    </form>
</body>
</html>
